<template>
    <el-container style="height: 700px; border: 1px solid #eee">
        <el-header style="font-size: 40px;">学生学习智能辅助系统</el-header>
        <el-container>
            <el-aside width="200px" style="background-color: rgb(238, 241, 246)">

                <el-menu :default-openeds="['1', '3']">
                    <el-submenu index="1">
                        <template slot="title"><i class="el-icon-message"></i>导航一</template>
                        <el-menu-item-group>
                            <el-menu-item index="1-1">管理选项</el-menu-item>
                            <el-menu-item index="1-2">员工选项</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>
            </el-aside>

            <el-main>
                <!-- 表单 -->
                <el-form :inline="true" :model="searchform" class="demo-form-inline">
                    <el-form-item label="姓名">
                        <el-input v-model="searchform.name" placeholder="姓名"></el-input>
                    </el-form-item>

                    <el-form-item label="性别">
                        <el-select v-model="searchform.gender" placeholder="性别">
                            <el-option label="男" value="1"></el-option>
                            <el-option label="女" value="2"></el-option>
                        </el-select>
                    </el-form-item>

                    <!-- 日期选择器 -->
                    <el-form-item label="入职日期">
                        <el-date-picker v-model="searchform.entrydate" type="daterange" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期">
                        </el-date-picker>
                    </el-form-item>
                </el-form>



                <el-form-item>
                    <el-button type="primary" @click="onSubmit">查询</el-button>
                </el-form-item>



                <!-- 表格 -->
                <el-table :data="tableData" border>
                    <el-table-column prop="date" label="日期" width="140">
                    </el-table-column>
                    <el-table-column prop="name" label="姓名" width="120">
                    </el-table-column>
                    <el-table-column prop="address" label="地址">
                    </el-table-column>
                </el-table>

                <!-- 分页条 -->
                <el-pagination background layout="total,sizes,prev, pager, next,jumper" @size-change="handleSizeChange"
                    @current-change="handleCurrentChange" :total="1000">
                </el-pagination>

            </el-main>
        </el-container>
    </el-container>



</template>

<script>
export default {
    data() {
        const item = {
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
        };
        return {
            tableData: Array(5).fill(item),
            searchform: {
                name: '',
                gender: '',
                entrydate: []
            }
        }
    },
    methods: {
        onSubmit() {
            alert('submit!');
        },
        handleSizeChange(val) {
            alert(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            alert(`当前页: ${val}`);
        }, 
    }
}
</script>

<style>
.el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
}

.el-aside {
    color: #333;
}
</style>